//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;

using ProjectBase.Core;
using ProjectBase.Core.Web;
using ProjectBase.Mvc;
using ProjectBase.Mvc.Controllers;

using Survey.Common;
using Survey.Common.Business;
using Survey.Common.Controllers;
using Survey.Common.Models;
using Survey.Entity;

namespace Survey.Mvc.Controllers
{
    /// <summary>
    ///     All actions for ContentType
    /// </summary>
    public class ContentTypeController
        : CodeListController<ContentType, ContentTypeFilter, IContentTypeModel, IContentTypeFacade>, IContentTypeController
    {
        #region OnListToExcel
        protected override IEnumerable<IEnumerable<IExCell>> LoadExcelItemsToDisplay(ContentTypeFilter filter)
        {
            return Facade.Find(filter)
                .Select(i => new List<IExCell>
                {
                    i.ExCell(() => i.ID),
                    i.ExCell(() => i.Code),
                    i.ExCell(() => i.Name),
                    i.ExCell(() => i.IsVisible),
                    i.ExCell(() => i.Suffix),
                });
        }
        #endregion OnListToExcel

        #region properties
        public override string ControllerName
        {
            get { return Str.Controllers.ContentType; }
        }
        #endregion properties
    }
}